package com.cky.network.yingyi;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class test {
    public static  void main(String[] args) {

        Map<String, Integer> map = new HashMap<>();
        for (int i = 1; i <= 6; i++) {
            map.put("第" + i + "个数据是", i);
        }
        System.out.println(map);

        System.out.println("------------------------------");



        List<Integer> list = new ArrayList<>();
        for (Map.Entry<String, Integer> keys : map.entrySet()) {
            String key = keys.getKey();
            int value = keys.getValue();
            list.add(value);
        }
        System.out.println("-----------------------------");


        for (int i = 1; i <= list.size(); i++) {
            int j = list.get(i - 1);
            if (j % 2 == 0) {
                System.out.println("为偶数: " + j);
            } else {
                System.out.println("为奇数: " + j);
            }
        }
    }
}
